Add the command line switch ^file where file is the name of the script
file containing the commands. In the event sFTP fails to find the file as
specified - it will look in the <sftp$dir>.Scripts directory. Each command
in the script file must be on a new line.
Lines starting with a ';' are treated as comments and are ignored.
Listing directories :
~~~~~~~~~~~~~~~~~~~~~
Type 'ls' to list the filenames in the current directory. To see a
full list of file information, type 'dir' or 'ls -l'.
To Change directories :
~~~~~~~~~~~~~~~~~~~~~~~
Type 'cd dirname', where dirname is the name of the directory that you
wish to change into. If you want to change into a directory several
levels down, then put a '/' betweem each directory name
e.g. if you were in the dir 'pub' on ftp.barnet then you could type :
cd Acorn/sftp
will change you in one go in the sftp directory.
cd .. and cdup will both change you into the parent of the current
directory.
To Download a file :
~~~~~~~~~~~~~~~~~~~~
Type 'get filename'.
At the moment the transfer information is only displayed correctly if you
are using !Zap - but I'm working on solutions for other text editors.
If it for some reason crashes partway through a download, you can reconnect
and then use the 'reget' command to continue downloading from the point at
which it had reached before the crash (providing the server you are
FTPing to supports the REST command).
This client supports 'mget' and if you remember to turn off prompt mode
first by typing 'prompt' then you can leave it to download multiple files
by answering 'a' to the first mget (y/n/a) ? question.
Set bell on by typing 'bell' and it will even beep to let you know when its
finished downloading a file.
To upload a file :
~~~~~~~~~~~~~~~~~~
Either switch to /incoming and put the file there, or log into a server
for which you already have an account, using a valid userid and password,
then 'put filename'.
Syslogging levels :
~~~~~~~~~~~~~~~~~~~
0 No Logging (Turns off logging altogether)
1 Startup
1 Shutdown
10 Connections
10 Server timeout
15 Client timeout
20 Get transfer speed
30 Put transfer speed
80 Changing the syslogging level
128 Command parameters
130 Replies from the server
135 User input
140 Error messages
150 Info messages
180 Entering a function
There are two ways to affect the syslog level for sftp:
1. You can alter the default value in the config box from the iconbar menu.
This however does not take effect till the next time you run the frontend.
2. Once connected you can type the command 'debug' followed by a number between
0 and 255. This takes effect immediately but will affect all currently
running sftp sessions. There is no way to have different levels for
different concurrently running sessions.
If you are experiencing a bug and can reproduce it - then please turn syslogging on to level 255 and send me the resultant log file.
The Frontend
~~~~~~~~~~~~
It seems there were 3 types of local dir capability wanted by users :-
- Those who liked the original idea of a fixed download dir inside the
sFTP application.
- Those who wanted to be able to specify different download directories
for different profiles.
- Those who wanted to be able to use the current CSD and to be able to
affect this using other utilities whilst running sFTP.
The new frontend layout is an attempt to cater for all 3 types of needs.
'Affect global CSD' - if you select this then if/when you change the
downloads directory - sFTP also changes the actual
CSD. And when you put or get - sFTP will use the
CSD. The CSD can then be affected from outside sFTP.
- if this is not selected, then changing the
downloads directory using lcd will not affect the
actual CSD and when you put or get - sFTP will
use the pathname held in its internal variable.
Command line switches :
~~~~~~~~~~~~~~~~~~~~~
-A Select ASCII mode. (Default is binary)
-Q Turn verbose mode off. (Default is on)
-B Turn bell on. (Default off)
-N Turn off prompt mode. (Default on)
-R Turn on unique remote filenames. (Default off)
-L Turn on unique local filenames. (Default off)
-G Turn on get newer files only. (Default off)
-P Turn on put newer files only. (Default off)
-C Affect the global CSD with local directory changes.
-D Open downloads directory once connected.
-X Client timeout in value. (How long to wait when expecting a
server response before giving up).
-S Turn off syslogging.
^filename Use a script file containing any of the below commands.
Here is a list of the commands I have implemented so far :-
Recognised commands :
~~~~~~~~~~~~~~~~~~~
Anything in [ ] is optional.
!command [args] Carry out a shell command. e.g. !cat
*command [args] A synonym for !
abort To abort the current download.
account [passwd] Supply a supplemental password required by
some remote systems for access to resources
once a login has been successfully completed.
append local-file [remote-file]
Appends the local file to an existing file on the
remote server.
asc Set the file transfer type to ASCII.
ascii A synonym for asc.
bell Turn on bell notification when end of file transfer.
default = nobell. (To turn off, type 'nobell'.)
binary Set the file transfer type to BINARY.
bin A synonym for binary. This is the default for each
sftp session, unless you were in ascii mode when
you saved a profile.
bye A synonym for quit.
cd remote-directory Change directory on the remote server to
remote-directory.
cdup Change directory on the remote server to the parent
of the current directory on the remote server.
cd .. A synonym for cdup.
chmod mode filename Change the permission modes of the file-name on the
remote system to mode.
close End the current ftp session.
debug nnn Sets the syslogging level to nnn. Where 0<=nnn>256.
Setting debug to 0 turns off syslogging.
delete filespec where filespec can be a single filename, multiple
filenames by using the wildcard '*' or a directory
name.
This attempts to delete the file(s) specified from the
remote server. If a directory is specified - then
sFTP attempts to delete the entire directory
including all subdirectories.
dir [remote_directory] A synonym for ls with the -l switch.
downloads Opens the currently selected downloads directory.
dput local-directory [remote-directory]
Attempts to put a whole directory including any
subdirectories to the remote host.
exit A synonym for quit.
get remote-file [local-file] Retrieve the remote-file and store it on
the local machine.
getnewer Sets a flag as on or off. If on, then files will
only be downloaded if they have a newer date and
timestamp.
help [command] Display help on sFTP client commands.
? [command] A synonym for help.
logout A synonym for close.
ls [remote-filespec] [-l]
List the current remote server directory.
The switch -l lists the full dir information.
lcd local-directory Change directory on the currently selected hard disk
to local-directory.
lcdup Change directory on the currently selected hard disk
to parent of the current directory.
lcd .. A synonym for lcdup.
lcd ^ A synonym for lcdup.
ldir [local-directory] A synonym for lls with the -l switch.
lls [local-directory] [-l]
List the current local drive directory.
lpwd Display the name of the current local hard disk
directory on the local machine where downloads
will be saved.
lunique Toggles unique local filenames on and off. (Takes
precedence over 'prompt').
mget remote-filespec Retrieve multiple files matching the filespec.
Each time you initiate an mget command, you will
be asked 'mget filename (y/n/a)?'.
By typing 'a' you won't be asked that question
again and it will go on and get all the files in
the filespec. If prompt mode is on - you will
however be asked to confirm overwrites if the file
already exists.
mkdir directory-name Attempts to create a new directory on the remote
server.
mput local-filespec Put multiple files matching the filespec.
nobell Turn off bell notification when end of file
transfer.
Default = nobell. (To turn on again, type 'bell).
open remote-host-addr [login-id [password [remote-dir [local-dir]]]]
Starts ftp session with remote server and optional
parameters. NB : the remote-host-addr is first
checked to see if it matches a profile name - which
takes precedence.
open profile Starts ftp session with a presaved profile
configuration.
profiles Lists the available pre-saved profiles.
prompt Toggles confirmation of overwrites on and off.
put local-file [remote-file] Upload specified file.
putnewer Sets a flag as on or off. If on, then files will
only be uploaded only if they have a newer date and
timestamp.
pwd Display the name of the current working directory
on the remote machine.
quit Exit the program closing all sessions.
quote string Sends the contents of 'string' direct to the control
channel.
read remote-file Attempts to display the remote-file in a text
editing window. Useful for e.g. to view index
files.
recv remote-file [local-file] A synonym for get.
reget remote-file [local-file] Attempts to get the rest of a partially
downloaded file and append it to what
you've got so far. Useful if something has
gone wrong - particularly if its a large
file you're attempting to download.
rename from to Rename the file 'from' on the remote server, to the
filename 'to'.
rhelp [command] Display what ftp commands the remote server has
currently implemented.
rmdir directory-name Remove an empty directory name on the remote server.
rstatus Show the current status of the remote server.
runique Toggles unique storing of files on the remote
server. (Only if the remote server allows for this).
save profile Saves the current configuration, using the name
'profile' to identify it.
send local-file [remote-file] A synonym for put.
site arg1 arg2 ... The arguments specified are sent, verbatim, to the
remote FTP server as a SITE command.
size file-name Return size of file-name on remote machine.
status Show the current status of sFTP.
system Show the type of operating system running on the
remote machine.
user user-name [password] Log into a remote system as a different
userid when you are already connected to a remote host. The userid must already exist.
verbose Toggles display of certain server messages on and off.
version Displays the current version number.
view remote-file A synonym for read.
Thanks to :
~~~~~~~~~
I would like to dedicate this program to Jogu - without who's help,
support, snippets of code, and consistent bug testing it would not have got
off the drawing board - or indeed be in its current operational state.
A special thanks to Reuben Thomas for consistent bug reporting and helpful
suggestions.
Thanks also to Juggler, vulch, willy, toolbox and Chris Latham for various snippets of code and helpful suggestions, Doggysoft for permission to use "WimpExt and WimpExtLib", Stewart Brodie for libresolv, Jonathan Coxhead for OSLib and Olly Betts for the Line Editor module.
Bug reports / Comments :
~~~~~~~~~~~~~~~~~~~~~~
If you discover a bug with !sFTP, or have a useful comment, improvement or
suggestion, please e-mail them to :-
sftp@nocturnal.demon.co.uk
If it is a bug report, please state the nature of the problem and
the FTP site and directory where the problem occurs (especially important
if the problem is reproduceable).
Better still - send me a copy of the taskwindow display (if you can)
so that I can see exactly what happened. Also - send me a copy of the syslog - preferably with logging set to 255.
Known bugs :
~~~~~~~~~~
Only one outstanding that I know of currently :- do not attempt to ftp to
ftp.uni-stuttgart.de using freenet v1.xx as freenet itself will crash and
you will have to reboot your computer. Not something I can do anything
about. I'm convinced its a freenet bug. Freenet v2.xx does not suffer